<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@include file="/static/common/taglib.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>图片设置</title>
    <%@include file="../../public/commonCss.jsp" %>
    <%@include file="../../public/commonJs.jsp" %>
    <%@include file="../../public/ueditor.jsp" %>
</head>
<body>
<div id="wrapper">
    <div class="boxmain whiteBox lrbox">
        <div class="lrboxmain borderL" style="margin-left:0%">
            <div class="from-header borderB contentbox">
                <div>
                    <span class="font14"> 所属分类:</span><a id="category"><span class=" fontOrange2">参数设置</span></a>
                </div>
            </div>
            <div class="from-body withheader contentbox" style="overflow: auto">
                <div class="fl layui-form">
                    <blockquote class="layui-elem-quote">app使用帮助</blockquote>
                    <textarea id="container" name="container" style="width: 700px;height: 400px;">${setting.app_help}</textarea>
                    <div class="layui-form-item" style="margin-top: 20px;">
                        <div class="layui-input-block">
                            <button class="layui-btn" onclick="saveContent()">保存</button>
                            <button class="layui-btn layui-btn-primary" onclick="preView()">预览</button>
                        </div>
                    </div>
                </div>
                <div class="layui-form layui-form-pane fl" style="margin-left: 30px">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">图片大小：</label>
                            <div class="layui-input-block" style="width: 400px;">
                                <input type="radio" name="picSize" value="150" title="1080P"/>
                                <input type="radio" name="picSize" value="100" title="720P"/>
                                <input type="radio" name="picSize" value="60" title="480P" checked/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">清晰度：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="picPx" value="2" title="高画质"/>
                                <input type="radio" name="picPx" value="1" title="中画质"/>
                                <input type="radio" name="picPx" value="0" title="低画质" checked/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">派班时长：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="hours" value="1" title="1h"/>
                                <input type="radio" name="hours" value="1.5" title="1.5h"/>
                                <input type="radio" name="hours" value="2" title="2h"/>
                                <input type="radio" name="hours" value="2.5" title="2.5h" checked/>
                                <input type="radio" name="hours" value="3" title="3h"/>
                                <input type="radio" name="hours" value="3.5" title="3.5h"/>
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" onclick="savePic()">保存</button>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
    <!-- whitebox -->
</div>
<script type="text/javascript">
    layui.form().render();
    var ue;

    $(function () {
        ue = UE.getEditor("container");
    });

    //关闭对话框
    function saveContent() {
        var url = "${ctx}/picSettingController/updatePicSetting.action";
        var dataStr = {
            contentHtml: ue.getContent()
        }
        ajaxUtil.post(url, dataStr, true, function (data) {
            layerUtil.success("更新成功");
        })
    }

    //预览
    function preView() {
        var url = "${ctx}/webView/appHelpShow";
        var dataStr = {
            contentHtml: ue.getContent()
        }
        layerUtil.preview(url, dataStr, "预览", ['450px', '90%']);
    }

</script>
</body>

</html>